Skip to content

Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up) #13050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Rather than having to spell out the English fallback strings at every single IL10n.get call-site throughout the viewer, we can simplify things by collecting them in one central spot.
This provides a much better overview of the fallback l10n strings used, which makes future changes easier and ensures that fallback strings occuring in multiple places cannot accidentally get out of sync.
Furthermore, by making the fallback parameter of the IL10n.get method optional[1] many of the call-sites (and their surrounding code) become a lot less verbose.


[1] It's obviously still possible to pass in a fallback string, it's just not required.

…function (PR 12981 follow-up)

Rather than having to spell out the English fallback strings at *every* single `IL10n.get` call-site throughout the viewer, we can simplify things by collecting them in *one* central spot.
This provides a much better overview of the fallback l10n strings used, which makes future changes easier and ensures that fallback strings occuring in multiple places cannot accidentally get out of sync.
Furthermore, by making the `fallback` parameter of the `IL10n.get` method *optional*[1] many of the call-sites (and their surrounding code) become a lot less verbose.

---
[1] It's obviously still possible to pass in a fallback string, it's just not required.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Mar 4, 2021

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/184daa7fc64466d/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 4, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/184daa7fc64466d/output.txt

Total script time: 4.10 mins

Published

@timvandermeij timvandermeij merged commit 4b49db7 into mozilla:master Mar 4, 2021
@timvandermeij
Copy link
Contributor

Looks really clean; thanks!

@Snuffleupagus Snuffleupagus deleted the l10n-fallback branch March 4, 2021 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants